<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        
        <script type="text/javascript">
           /*
            while循环 
           */
            var month = 0;
            while(month < 4){
                alert(month)
                month ++
            }

            //do while循环:求1-10整数和:无论条件是否成立，至少会执行一次
            var sum = 0;
            var i = 1;
            do{
                sum+=i;
                i++;
            } while(i <= 10);
            alert(sum)

            var sum2 = 0;
            for(var j=1;j <= 10;j ++){
                sum2+=j;
            }
            alert(sum2)
        </script>
    </head>
    <body>

    </body>
</html>